<%@ Page debug="true" Trace="false" %>

<%@ Import Namespace="System.IO" %>

<html>
<head>
<!--------------------------------------------------------------------------->

<html>

<script language="VB" runat="server">

	Sub Page_Load(Sender As Object, e as EventArgs)

	  'try
		contents.Text = GetFileContents("")
	  'catch ex as argumentexception
	  '  contents.Text = ex.InnerException.message
	  'end try
	End Sub

	Function GetFileContents(file As String) As String
	
		Dim contents As String = ""
		
		Try
			Dim sr As New StreamReader(file)
			contents = sr.ReadToEnd()
			sr.Close()
		
		Catch exArg As ArgumentException
			Throw New ArgumentException("Doh - you forgot the filename.", exArg)
			
		Catch exFNF As FileNotFoundException
			Throw New FileNotFoundException("Hmm - file missing.", file)

		Finally
			
			
		End Try
	
		return contents
		
	End Function
	
</script>

<asp:Label id="contents" runat="server"/>

<!--------------------------------------------------------------------------->
